import java.util.Scanner;

public class Main1742 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int m= sc.nextInt();
        int n= sc.nextInt();
        int x=0;
        for (int i=m;i<=n;i++){
            int a=i/100;//1
            int c=i%10;
            if (a==c){
                x++;
                System.out.println(i);
            }
        }System.out.println(x);
    }
}
